package com.lyf.scm.admin.domain.remote.allocationservice;

import com.github.pagehelper.PageInfo;
import com.lyf.scm.admin.api.dto.*;
import com.rome.arch.core.clientobject.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 需求计划
 *
 * @author wangchlei
 * @date 2020/10/26
 */
@FeignClient(name = "scm-plan-service")
public interface RequirementPlanRemote {
    @PostMapping("/api/v1/requirements/listByWeek")
    Response<PageInfo<RequirementPlanInfoDTO>> listWeekBySelective(@RequestBody RequirementPlanDTO requirementPlanDTO);

    @PostMapping("/api/v1/requirements/confirmQty")
    Response updateConfirmQty(@RequestBody List<RequirementConfirmationDTO> requirementConfirmationDTOs, @RequestParam("unitType") Long unitType);

    @PostMapping("/api/v1/requirements/eChartsData")
    Response<EChartsDTO> listAllByCycles(@RequestBody RequirementPlanDTO requirementPlanDTO);

    /**
     * 导出excel
     *
     * @param requirementPlanDTO 需求计划dto
     * @param type               类型
     * @return {@link Response}
     */
    @PostMapping(value = "/api/v1/requirements/export", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    feign.Response exportExcel(@RequestBody RequirementPlanDTO requirementPlanDTO, @RequestParam("type") Integer type);

}
